import factory from '@adonisjs/lucid/factories'
import Goods from '#models/goods'

export const GoodsFactory = factory
  .define(Goods, async ({ faker }) => {
    return {
      fkShopId: 1,
      fkCategoryId: faker.number.int({ min: 1, max: 6 }),
      fkWarehouseId: faker.number.int({ min: 1, max: 6 }),
      fkSupplierId: faker.number.int({ min: 1, max: 6 }),
      fkBuyUnitId: faker.number.int({ min: 1, max: 6 }),
      buyUnitNumber: faker.number.int({ min: 1, max: 6 }),
      buyUnitPrice: faker.number.int({ max: 66 }),
      fkStandardUnitId: faker.number.int({ min: 1, max: 6 }),
      name: faker.commerce.product(),
      spec: faker.commerce.productMaterial(),
      normalPrice: faker.number.int({ min: 66, max: 9999 }),
      barCode: faker.commerce.productAdjective() + faker.number.int({ max: 888 }),
    }
  })
  .build()
